#include "Modelpart.h"
#include <gl/glut.h>

/************************************************************************/
/*                        PUBLIC METHODS                                */
/************************************************************************/

Modelpart::Modelpart()
{
    this->boundingVolume = NULL;
    this->errLog = NULL;
}

Modelpart::Modelpart(Log *log)
{
    this->boundingVolume = NULL;
    this->errLog = log;
}

Modelpart::Modelpart(Log *log, std::string name)
{
    this->errLog = log;
    this->boundingVolume = NULL;
    this->name = name;
}

Modelpart::~Modelpart()
{
    if(this->boundingVolume != NULL)
        delete this->boundingVolume;
}

void Modelpart::SetModelTransformationMatrix(const aiMatrix4x4 &transf)
{
    this->modelTransformation = transf;
}

void Modelpart::SetDisplayListID(unsigned int id)
{
    this->displayListID = id;
}

void Modelpart::SetName(const std::string &name)
{
    this->name = name;
}

void Modelpart::SetBoundingVolume(ModelBoundingVolume *bv)
{
    this->boundingVolume = bv;
}

const aiMatrix4x4 &Modelpart::GetModelTransformationMatrix()
{
    return this->modelTransformation;
}

unsigned int Modelpart::GetDisplayListID()
{
    return this->displayListID;
}

const std::string &Modelpart::GetName()
{
    return this->name;
}

ModelBoundingVolume *Modelpart::GetBoundingVolume()
{
    return this->boundingVolume;
}

void Modelpart::Draw()
{
    glCallList(this->displayListID);
}

/************************************************************************/
/*                        PRIVATE METHODS                               */
/************************************************************************/
